﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ServiceStack.DataAnnotations;
using ServiceStack.OrmLite;
using ServiceStack.OrmLite.Sqlite;
using wsy.ext.servicestack.ormlite;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            OrmLiteConfig.DialectProvider=SqliteOrmLiteDialectProvider.Instance;
           var db= "d.db".OpenDbConnection();
            db.CreateTableIfNotExists<a>();
            List<a> aa=new List<a>();
            aa.Add(new a(){Id = 1,S="1"});
            aa.Add(new a() { Id = 1, S = "1" });
            aa.Add(new a() { Id = 2, S = "1" });
            aa.Add(new a() { Id = 2, S = "1" });
            var errors =new List<a>();
            Progress<int> p=new Progress<int>();
            p.ProgressChanged +=(sender, e)=>{ Console.WriteLine(e); } ;
            db.InsertAllFix(aa,ref errors);
            Console.Read();
        }


    }

    public class a
    {
        [PrimaryKey]
        public int Id { get; set; }
        public string S { get; set; }
    }
}
